<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="theme-color" content="#181c20" />
    <title><%=luci.sys.hostname()%></title>
</head>
<body>
    <script src="<%=url('admin/translations', luci.i18n.context.lang)%><%# ?v=PKG_VERSION %>"></script>
    <script src="<%=resource%>/cbi.js<%# ?v=PKG_VERSION %>"></script>
    <script type="text/javascript" src="<%=resource%>/promis.min.js<%# ?v=PKG_VERSION %>"></script>
    <script type="text/javascript" src="<%=resource%>/luci.js<%# ?v=PKG_VERSION %>"></script>
    <%+tasks/embed%>
    <script>
        (function(){
            var pathe_prefix    =   "<%=prefix%>"
            window.path_base    =   pathe_prefix
            window.pkg_version  =   "<%# PKG_VERSION %>"
            window.token        =   "<%=token%>"
        })();
    </script>
    <script type="text/javascript">
      L = new LuCI(<%= luci.http.write_json({
        token          = token,
        media          = media,
        resource       = resource,
        scriptname     = luci.http.getenv("SCRIPT_NAME"),
        pathinfo       = luci.http.getenv("PATH_INFO"),
        documentroot   = luci.http.getenv("DOCUMENT_ROOT"),
        requestpath    = luci.dispatcher.context.requestpath,
        dispatchpath   = luci.dispatcher.context.path,
        pollinterval   = luci.config.main.pollinterval or 5,
        ubuspath       = luci.config.main.ubuspath or '/ubus/',
        sessionid      = luci.dispatcher.context.authsession,
        nodespec       = luci.dispatcher.context.dispatched,
        apply_rollback = math.max(applyconf and applyconf.rollback or 90, 30),
        apply_holdoff  = math.max(applyconf and applyconf.holdoff or 4, 1),
        apply_timeout  = math.max(applyconf and applyconf.timeout or 5, 1),
        apply_display  = math.max(applyconf and applyconf.display or 1.5, 1),
        rollback_token = rollback_token
      }) %>);
    </script>
    
    <div id="app"></div>
    <script type="module" src="http://localhost:3000/src/main.ts"></script>
</body>
</html>